{% extends "panel.html" %}
{% block content %}
	<div class="book">
	{% if book %}
		<div class="info">
	    	<h1>{{book.title}}</h1>
		    {% for author in authors %}
			    <h2>{{author.author}}</h2>
		    {% endfor %}
		</div>
		<div class="image">
	    	{% if book.image_url %}
				<img src="{{ book.image_url }}"/>
			{% else %}
				<div><img src="/img/image_not_found.jpg"/></div>
			{% endif %}
		</div>
		<div class="desc">
			<p>{{book.description|striptags}}</p>
		</div>
		<div class="price">
			<table>
				<tr>
					<th class="ui-state-active">Vendor</th>
					<th class="ui-state-active">Condition</th>
					<th class="ui-state-active">Price</th>
					<th class="ui-state-active">Purchase</th>
				</tr>
	    	{% for price in prices %}
				<tr>
					<td>{{price.vendor}}</td>
					<td>{{price.condition}}</td>
					<td>${{price.price|floatformat:2}}</td>
					<td>
						<a href="#add" class="outlet" outlet="cart_add" methods="click" pid="{{book.uuid}}" ttl="{{book.title}}" prc="{{price.price}}" url="{{price.purchase_url}}" vnd="{{price.vendor}}">
							<img src="/img/weby/Shopping_Cart_Add.png">
						</a>
					</td>
				</tr>
			{% endfor %}
			</table>
	   	</div>
	{% else %}
    	<h1>Item does not exist. Check the product ID and try again.</h1>
	{% endif %}
	</div>
{% endblock %}
